import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNumber, IsOptional, Min } from 'class-validator';

/**
 * 解锁资源DTO
 */
export class UnlockResourceDto {
  @ApiProperty({ description: '消耗金额（单位：分）', example: 500 })
  @IsNumber()
  @Min(1)
  amountUsed: number;

  @ApiProperty({ description: '资源类型', example: 'course' })
  @IsString()
  resourceType: string;

  @ApiProperty({ description: '资源ID', example: 1, required: false })
  @IsOptional()
  @IsNumber()
  resourceId?: number;

  @ApiProperty({ description: '资源名称', example: '高级足球战术课程', required: false })
  @IsOptional()
  @IsString()
  resourceName?: string;

  @ApiProperty({ description: '使用描述', example: '解锁高级课程', required: false })
  @IsOptional()
  @IsString()
  description?: string;
}